package cn.control;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.dao.hotel_userDao;
import cn.pojo.hotel_user;

@SuppressWarnings("serial")
public class registerHotel extends HttpServlet {
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String ID = req.getParameter("HG_phone");
		String pw = req.getParameter("HG_passwd");
		hotel_user ss = new hotel_user(); ;hotel_userDao aa = new hotel_userDao();boolean text = false;
		ss.setHU_Id(ID);
		ss.setHU_Passwd(pw);
		try {
			text = aa.addHotel_User(ss);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		resp.sendRedirect("jsp/login.jsp");
		
	}
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
}
